// All source files and native code may not be transmitted, reproduced, distributed, 
// or commercially exploited in any way without the express written consent of Sybex Inc.

//MOST THINGS THAT CHANGE

//CHAPTER TITLE
var TestChapter:String = "Chapter 6";

var user_Correct:Array = new Array("D","B","A","B","B","A","C","A","AC","CD","A","B","A","C","C","B","A","B","D","D");

total = user_Correct.length;
_root.countdown = false;
// set to false to make the timer count up //
_root.hour = 0;
// number of hours at start//
_root.minute = 0;
// number of minutes at start//
//DON'T FORGET THE QUESTIONS AT THE END
//END OF MOST THINGS THAT CHANGE
//
//
//The following is used in the timer mc for adjusting the clock.
_root.delay = false;
_root.wait = 60;
//wait in seconds
_root.lastTime = Math.floor(getTimer()/1000);
i = 1;
totalCorrect = 0;
totalWrong = 0;
QCounter.QTotal.text = total;
Test_Title.text = TestChapter;
var finalCorrect:Number;
var userResponse:Array = new Array(total);
var markResponse:Array = new Array(total);
user_responseA = "";
user_responseB = "";
user_responseC = "";
user_responseD = "";
user_responseE = "";
user_responseF = "";
user_responseG = "";
user_responseH = "";
user_responseI = "";
user_responseJ = "";
user_responseK = "";
user_responseL = "";
user_responseM = "";
user_responseN = "";
_root.review = false;

function initialize() {
	_root.review = false;
	for (j=0; j<total; j++) {
		userResponse[j] = "";
		markResponse[j] = "";
	}
	
}

function showMatch() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;
}

// display multiple choice user_response answer function
function display() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;

	//**NEW
	response.text = userResponse[i-1];
	
}

//radio button function
function answer(choice) {
	set("user_response"+i, choice);
	userResponse[i-1] = choice;
	
	//**NEW
	response.text = userResponse[i-1];	
}

// marker button fuction
function mark(choice) {
	_root["mark"+i] = choice;
	markResponse[i-1] = choice;
}

// display fill in the blank by user.
function submit(userInput) {
	_root["user_response"+i] = userInput;
}

function reset() {
	_root["user_response"+i] = "";
}

function UnloadReview() {
	//ReviewLinks.unloadMovie();
}


function LayoutQuestion() {

	qname = "q"+(_root._currentframe-1);
	
	markname = "m"+(_root._currentframe-1);
	
	_root.loadQuestion(_root._currentframe-1);	
	
	_root.createEmptyMovieClip("container", 1);

	_root.attachMovie("Marker_mc", markname, 2, {_x:65.4, _y:55.4});
	
	if (_root.question_type == "2R") { this.attachMovie("2R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3R") { this.attachMovie("3R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3MC") { this.attachMovie("3MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4R") { this.attachMovie("4R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4MC") { this.attachMovie("4MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5R") { this.attachMovie("5R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5MC") { this.attachMovie("5MC", qname, 1, {_x:24, _y:165}); }	
	if (_root.question_type == "6R") { this.attachMovie("6R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "6MC") { this.attachMovie("6MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7R") { this.attachMovie("7R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7MC") { this.attachMovie("7MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8R") { this.attachMovie("8R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8MC") { this.attachMovie("8MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9R") { this.attachMovie("9R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9MC") { this.attachMovie("9MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10R") { this.attachMovie("10R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10MC") { this.attachMovie("10MC", qname, 1, {_x:24, _y:165}); }


	if (_root.review == false) { _root.attachMovie("show_answer", "show_answer1", 3, {_x:72, _y:418}); }
	if (_root.review == true)  { _root.attachMovie("show_review", "show_review1", 3, {_x:72, _y:418}); }
        if (_root.figure_flag == "True") { _root.attachMovie("show_figure", "show_figure1", 6, {_x:72, _y:418}); }
        if (_root.figure_flag == "False") { _root.createEmptyMovieClip("container", 6); }        

	question_scroll._visible = (question_text.maxscroll > 1);
	question_scroll.setSize(85,16); 
	
	//**NEW
	response.text = userResponse[i-1];
}

function loadQuestion(inNum:Number) {
	var cur:Number = inNum;
	//This corrects for the first frame holding all functions
	//QUESTIONS AND ANSWERS CAN ACCEPT HTML FORMATTING!!!
	//EACH QUESTION SHOULD BE FORMATTED SIMILAR TO THE FOLLOWING.

	switch (cur) {
case 1 :
_root.question = "Omnidirectional antennas have a horizontal beamwidth of _______degrees.";
_root.answerA = "90";
_root.answerB = "180";
_root.answerC = "270";
_root.answerD = "360";
_root.correct = "D";
_root.explanation = "Omnidirectional antennas have a horizontal beamwidth of 360. The vertical beamwidth will vary depending on the design and the gain of the antenna.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 2 :
_root.question = "Antennas provide an increase in RF coverage by using _______ gain.";
_root.answerA = "Active";
_root.answerB = "Passive";
_root.answerC = "Positive";
_root.answerD = "Maximum";
_root.correct = "B";
_root.explanation = "Antennas provide an increase in RF coverage by means of passive gain. Passive gain occurs when isotropic RF energy is focused into a specific radiation pattern. Active gain requires the use of an external power source.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 3 :
_root.question = "Horizontal beamwidth is ______ to the earths surface.";
_root.answerA = "Parallel";
_root.answerB = "Perpendicular";
_root.answerC = "Positive";
_root.answerD = "Negative";
_root.correct = "A";
_root.explanation = "Horizontal beamwidth is parallel to the earths surface. This is based on how the E-field propagates away from the antenna element. Vertical beamwidth is perpendicular to the earths surface.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 4 :
_root.question = "An access point requires _____ antennas for diversity functionality.";
_root.answerA = "One";
_root.answerB = "Two";
_root.answerC = "Three";
_root.answerD = "Six";
_root.correct = "B";
_root.explanation = "An access point will require two antennas for diversity. Although there are two antennas, a single input/single output access point will have only one radio. The access point provides additional intelligence to determine which antenna to use. Other wireless LAN technologies such as MIMO may use up to three antennas.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 5 :
_root.question = "What device is used to shunt transient current to ground in the event of an indirect lightning strike?";
_root.answerA = "Lightning suppressor";
_root.answerB = "Lightning arrestor";
_root.answerC = "Lightning prevention";
_root.answerD = "Lightning breaker";
_root.correct = "B";
_root.explanation = "A lightning arrestor is used to protect a wireless LAN system from indirect lightning strike. A lightning arrestor will direct transient or induced electrical current to earth ground as a result of lightning strike.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 6 :
_root.question = "Amplifiers provide an increase in signal strength by using _______ gain.";
_root.answerA = "Active";
_root.answerB = "Passive";
_root.answerC = "Positive";
_root.answerD = "Maximum";
_root.correct = "A";
_root.explanation = "Active gain requires an external power source to provide an increase in signal strength. An amplifier is an example of a device that uses active gain. Antennas provide an increase in strength by using passive gain.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 7 :
_root.question = "Highly directional antennas are typically used for ______ connectivity.";
_root.answerA = "Short-range";
_root.answerB = "Omnidirectional";
_root.answerC = "Long-range";
_root.answerD = "Dipole";
_root.correct = "C";
_root.explanation = "Highly directional antennas are typically used for long-range point-to-point connectivity such as bridge links. Omnidirectional antennas are typically used as part of an access point system or to provide point-to-multipoint links.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 8 :
_root.question = "You are a network engineer. While moving a handheld wireless LAN device, you notice that the signal strength increases when the device is moved from a horizontal to a vertical position. This is because the _______ is changing.";
_root.answerA = "Polarization";
_root.answerB = "Wavelength";
_root.answerC = "Frequency";
_root.answerD = "Phase";
_root.correct = "A";
_root.explanation = "Changing the orientation of a device or antenna will change the polarization and affect the received signal strength. The signal strength may either increase or decrease depending upon how the polarization is changed from the original position. Wavelength, frequency, and phase are characteristics of radio frequency.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 9 :
_root.question = "RF line of sight is required for what type of IEEE 802.11 WLAN installation? (Choose two.)";
_root.answerA = "Point-to-point";
_root.answerB = "Scattered";
_root.answerC = "Point-to-multipoint";
_root.answerD = "Reflected";
_root.answerE = "Refracted";
_root.correct = "AC";
_root.explanation = "Point-to-point and point-to-multipoint both require RF line of sight to be able to effectively communicate. Scattering, reflection, and refraction are all behaviors of radio frequency.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 10 :
_root.question = "Which can cause a loss in signal strength? (Choose two.)";
_root.answerA = "Antenna";
_root.answerB = "Amplifier";
_root.answerC = "Cable";
_root.answerD = "Connector";
_root.answerE = "Transmitter";
_root.correct = "CD";
_root.explanation = "Cables and connectors can both result in a loss of signal strength. Antennas and amplifiers will add gain or increase signal strength. A transmitter outputs an absolute amount of power.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 11 :
_root.question = "An IEEE 802.11g access point requires a minimum of how many antennas to move data?";
_root.answerA = "One";
_root.answerB = "Two";
_root.answerC = "Four";
_root.answerD = "Six";
_root.correct = "A";
_root.explanation = "802.11b access points require only one antenna to function. Systems that support antenna diversity will require two antennas to correctly operate.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 12 :
_root.question = "802.11a access points support which antenna technology to help reduce the effects of multipath?";
_root.answerA = "Adjustable gain";
_root.answerB = "Antenna diversity";
_root.answerC = "Adjustable polarization";
_root.answerD = "Antenna multiplexing";
_root.correct = "B";
_root.explanation = "802.11a access points can use antenna diversity. Gain and polarization are considered RF concepts.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 13 :
_root.question = "The following graphic shows what type of antenna?";
_root.answerA = "Omnidirectional";
_root.answerB = "Yagi";
_root.answerC = "Patch/panel";
_root.answerD = "Parabolic dish";
_root.correct = "A";
_root.explanation = "The image is an example of an omnidirectional antenna. This type of antenna provides a horizontal radiation pattern of 360 degrees.";
_root.figure = "&nbsp;<img src ='img/g0605.swf'>";
_root.figure_flag = "True";
_root.question_type = "4R";
break;

case 14 :
_root.question = "Which weather element would commonly have an affect on a wireless LAN system?";
_root.answerA = "Rain";
_root.answerB = "Snow";
_root.answerC = "Wind";
_root.answerD = "Hail";
_root.correct = "C";
_root.explanation = "Of the answers listed, wind would have the biggest impact on a wireless LAN system. Rain, snow, and hail do not affect wireless transmission unless the weather is severe. In this case, the collection of the elements may have an impact on the wireless LAN signal transmitted or received.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 15 :
_root.question = "Wireless network cables and devices have impedance (AC resistance) of _____ ohms.";
_root.answerA = "10";
_root.answerB = "25";
_root.answerC = "50";
_root.answerD = "75";
_root.correct = "C";
_root.explanation = "Wireless LAN cables and devices are rated at 50 ohms impedance. Cable and satellite television is rated at 75 ohms.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 16 :
_root.question = "The curvature of the earth will have an impact on the wireless LAN signal after how many miles?";
_root.answerA = "2";
_root.answerB = "7";
_root.answerC = "10";
_root.answerD = "25";
_root.correct = "B";
_root.explanation = "The curvature of the earth or earth bulge will have an impact on a wireless LAN signal after seven miles. If the signal needs to travel farther than seven miles, the antenna will have to be installed in a higher location.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 17 :
_root.question = "A patch antenna is an example of what type of antenna?";
_root.answerA = "Semidirectional";
_root.answerB = "Omnidirectional";
_root.answerC = "Highly directional";
_root.answerD = "Dipole-directional";
_root.correct = "A";
_root.explanation = "A patch antenna will provide semidirectional coverage. The amount of coverage depends on the design and gain of the antenna. Parabolic dishes are highly directional.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 18 :
_root.question = "An azimuth chart shows which RF radiation pattern?";
_root.answerA = "Vertical";
_root.answerB = "Horizontal";
_root.answerC = "Positive";
_root.answerD = "Negative";
_root.correct = "B";
_root.explanation = "The horizontal RF radiation pattern of an antenna is displayed using an azimuth chart. The vertical radiation pattern is displayed using an elevation chart.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 19 :
_root.question = "A point-to-point wireless link requires what percent of the Fresnel zone to be clear in order to be considered to have an acceptable RF line of sight?";
_root.answerA = "0";
_root.answerB = "20";
_root.answerC = "40";
_root.answerD = "60";
_root.correct = "D";
_root.explanation = "It is recommended that at least 60 percent of the Fresnel zone be free of obstruction in order to have acceptable RF line of sight. Up to 40 percent of the zone can be blocked by obstructions without affecting the signal.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 20 :
_root.question = "The image below shows what type of antenna?";
_root.answerA = "Highly directional";
_root.answerB = "Dipole-directional";
_root.answerC = "Omnidirectional";
_root.answerD = "Semidirectional";
_root.correct = "D";
_root.explanation = "The image shows a patch antenna. This is an example of a semidirectional antenna.";
_root.figure = "&nbsp;<img src = 'img/g0606.swf'>";
_root.figure_flag = "True";
_root.question_type = "4R";
break;

	}
		
	QCounter.QCurrent.text = cur;
}

initialize();


//Change the following question numbers to the indicated question type!
//1. 4R
//2. 4R
//3. 4R
//4. 4R
//5. 4R
//6. 4R
//7. 4R
//8. 4R
//9. 5MC
//10. 5MC
//11. 4R
//12. 4R
//13. 4R
//14. 4R
//15. 4R
//16. 4R
//17. 4R
//18. 4R
//19. 4R
//20. 4R





//